/*
 * 创建日期 2009-3-17
 *
 * 成都天和软件公司
 * 电话：028-85425861
 * 传真：028-85425861-8008
 * 邮编：610041 
 * 版权所有
 */
package  org.fantasy.cpp.web.tag.edit;

import java.io.PrintWriter;
import java.io.Writer;

import javax.servlet.jsp.JspException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import  org.fantasy.cpp.core.bean.ParamContext;
import  org.fantasy.cpp.core.html.edit.EditHtmlFactory;
import  org.fantasy.cpp.web.tag.BaseTag;


/**
 * 隐藏框
 * @author: 王文成
 * @version: 1.0
 * @since 2009-3-17
 */
public class HiddenTag extends BaseTag {
    private static final Log log = LogFactory.getLog(SelectTag.class);

    @Override
    public int doEndTag() throws JspException {
        Writer out = getJspWriter();
        try {
            String html = getHtml();
            out.write(html);
            out.flush();
        } catch (Exception e) {
            log.error(e);
            e.printStackTrace(new PrintWriter(out));
            return SKIP_PAGE;
        }
        return EVAL_PAGE;
    }

    private String getHtml() throws Exception {
    	ParamContext param = getParamContext();
        return EditHtmlFactory.getHiddenHtml(getRequest(), param).getHtml();
    }
}
